package cn.tlb.ui.widget;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

import java.io.File;
import java.io.FileOutputStream;

import cn.tlb.Constants;
import cn.tlb.utils.ClassParser;
import cn.tlb.xutilsdownload.R;

public class NumberPickerActivity extends AppCompatActivity {
    private static final String TAG = NumberPickerActivity.class.getSimpleName();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_number_picker);

        View decorView = getWindow().getDecorView();
        Log.i(TAG, "decorView:  "+decorView);
        String classText = ClassParser.getClassText(decorView);
        try {
            File file = new File(Constants.SAVE_PATH);
            if(!file.exists()){
                file.mkdirs();
            }
            FileOutputStream out = new FileOutputStream(new File(file,"DecorView.java"));
            out.write(classText.getBytes());
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
